const Webpack = require('webpack');
const ora = require('ora');
const chalk = require('chalk');
const dllUtil = require('./dll.util');

const spinner = ora('building for vue dll...');
spinner.start();

Webpack(dllUtil('vue', {
    libs: ['vue', 'vuex', 'vue-router']
}))
.run((err, stats)=>{
    spinner.stop();
    if (err) throw err;

    process.stdout.write(stats.toString({
        colors: true,
        modules: false,
        children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
        chunks: false,
        chunkModules: false
    }) + '\n\n');

    console.log(chalk.cyan('  Build complete.\n'))
});